﻿using System;
using System.Data;
using System.Runtime.Serialization;

namespace OpenComposite.HumanActivity.Contracts
{
	[DataContract(Namespace = "http://www.OpenComposite.com/internal")]
	public abstract class ItemBase
	{
		protected int? getNullableInt(DataRow row, string columnName)
		{
			return ( !row.Table.Columns.Contains(columnName) || row.IsNull(columnName) ?
				null : (int?)row[columnName] );
		}
		protected DateTime? getNullableDateTime(DataRow row, string columnName)
		{
			return ( !row.Table.Columns.Contains(columnName) || row.IsNull(columnName) ?
				null : (DateTime?)row[columnName] );
		}
	}
}
